package com.skt.common_hr.biztrip_sac.model.vo
{
	import com.wcl.utils.NumberUtil;

	[Bindable]
	public class MemberAdjustVO
	{
		public var PERNR:String;			// 사원 번호
		public var ENAME:String;				// 사원 또는 지원자의 포맷된 이름
		public var TRTICH:String;				// 지급여부 ("X")
		public var DAYPY:Number = 0;				// 일비
		public var PCARC:String;				// 개인차량이용
		public var OCARC:String;				// 회사차량이용
		public var DRIKM:Number = 0;			// 운행거리
		public var PCAPY:Number = 0;				// 유류비
		public var EATPY:Number = 0;				// 식비
		public var STYPY:Number = 0;				// 숙박비
		public var TRAPY:Number = 0;				// 교통비
		public var AIRPY:Number = 0;				// 항공료
		public var WAERS:String = "KRW";			// 통화 키
		public var EGBN:String;					// 연수/세미나 여부

		public function get sum():String
		{
			return NumberUtil.NumberFormat(sumN);
		}
		public function set sum(s:String):void
		{

		}
		public function get sumN():Number
		{
			return DAYPY + PCAPY + EATPY + STYPY + TRAPY + AIRPY;
		}

		public var _vehicle:String='';
		public function get vehicle():String
		{
			//return (PCARC=="X") ? "개인차량": "";
			var rtn:String='';
			if(PCARC=="X" && OCARC == "X") {
				rtn = '개인차량';
			} else if(PCARC=="X") {
				rtn = '개인차량';
			} else if(OCARC=="X") {
				rtn = '회사차량';
			} else {
				rtn = '';
			}
			
			return rtn;
		}

		public function set vehicle(s:String):void
		{
			_vehicle = s;
		}
		public function get DAYPY_F():String
		{
			return NumberUtil.NumberFormat(DAYPY);
		}
		public function set DAYPY_F(s:String):void
		{}
		public function get PCAPY_F():String
		{
			return NumberUtil.NumberFormat(PCAPY);
		}
		public function set PCAPY_F(s:String):void
		{}
		public function get EATPY_F():String
		{
			return NumberUtil.NumberFormat(EATPY);
		}
		public function set EATPY_F(s:String):void
		{}
		public function get STYPY_F():String
		{
			return NumberUtil.NumberFormat(STYPY);
		}
		public function set STYPY_F(s:String):void
		{}
		public function get TRAPY_F():String
		{
			return NumberUtil.NumberFormat(TRAPY);
		}
		public function set TRAPY_F(s:String):void
		{}
		public function get AIRPY_F():String
		{
			return NumberUtil.NumberFormat(AIRPY);
		}
		public function set AIRPY_F(s:String):void
		{}
		public function clone():MemberAdjustVO
		{
			var target:MemberAdjustVO = new MemberAdjustVO();
			target.PERNR 	= this.PERNR;
			target.ENAME 	= this.ENAME;
			target.TRTICH 	= this.TRTICH;
			target.DAYPY 	= this.DAYPY;
			target.PCARC 	= this.PCARC;
			target.DRIKM	= this.DRIKM;
			target.OCARC 	= this.OCARC;
			target.PCAPY 	= this.PCAPY;
			target.EATPY 	= this.EATPY;
			target.STYPY 	= this.STYPY;
			target.TRAPY 	= this.TRAPY;
			target.AIRPY 	= this.AIRPY;
			target.WAERS 	= this.WAERS;
			target.EGBN		= this.EGBN;
			return target;
		}

		public function get id():String
		{
			return ENAME+ "(" +PERNR+")"
		}
		public function set id(s:String):void
		{

		}
		public function get trtich():Boolean
		{
			return (TRTICH=="X") ? true:false;
		}
		public function set trtich(v:Boolean):void
		{
			TRTICH = (v) ? "X":"";
		}
		public function get seminar():Boolean
		{
			return (EGBN=="X") ? true : false;
		}
		public function set seminar(v:Boolean):void
		{
			this.EGBN = (v) ? "X" : "";
		}
	}
}